feat: add integration testing infrastructure and coverage reporting#85
feat: add integration testing infrastructure and coverage reporting#85joshsmithxrm merged 9 commits intomainfrom
Conversation
Add three new test projects for comprehensive integration testing:
- PPDS.Dataverse.IntegrationTests: FakeXrmEasy v3.8.0 for mocked Dataverse tests
- PPDS.Auth.IntegrationTests: Authentication flow validation
- PPDS.LiveTests: Live Dataverse connection tests with skip logic
Infrastructure includes:
- FakeXrmEasyTestsBase with middleware builder (RPL-1.5 license)
- LiveTestBase with [Trait("Category", "Integration")] for filtering
- SkipIfNoCredentials attributes for graceful credential handling
- LiveTestConfiguration reading from environment variables
CI/CD changes:
- integration-tests.yml: Approach B workflow (trusted PRs get integration tests)
- test.yml: Updated to exclude integration tests with --filter
- dependabot.yml: Added fakexrmeasy group for package updates
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add coverage collection and Codecov integration for visibility into test coverage across all packages. Changes: - test.yml: Add --collect:"XPlat Code Coverage" and Codecov upload - codecov.yml: Per-package thresholds matching issue #55 targets - .gitignore: Exclude coverage/ directory Per-package targets (informational only, no PR blocking): - PPDS.Plugins: 95% (currently 100%) - PPDS.Auth: 70% (currently 0% - no tests) - PPDS.Dataverse: 60% (currently 38%) - PPDS.Migration: 50% (currently 0% - no tests) - PPDS.Cli: 60% (currently ~12%) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Change matcher from "Bash" to "Bash(git commit:*)" so hook only fires on commit commands, not every Bash invocation - Use relative path instead of $CLAUDE_PROJECT_DIR which wasn't expanding correctly on Windows - Simplify Python script since matcher now handles filtering 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary of ChangesHello @joshsmithxrm, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the project's testing capabilities by laying the groundwork for robust integration tests and introducing automated code coverage analysis. It also includes a crucial fix for the pre-commit hook, improving developer experience, especially on Windows. These changes collectively aim to improve code quality, reliability, and maintainability by providing better feedback mechanisms for new and existing code. Highlights
Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a comprehensive integration testing infrastructure and code coverage reporting, which are excellent additions for improving project quality and maintainability. The structure with different test projects for mocked, auth, and live tests is well-designed. The pre-commit hook has also been nicely simplified. My review focuses on a few areas in the new test code to improve resource management, reduce code duplication, and strengthen test assertions. Overall, this is a solid contribution.
There was a problem hiding this comment.
Pull request overview
This PR implements Phase 1 of integration testing infrastructure along with code coverage reporting. It adds three new test projects for different testing scenarios (FakeXrmEasy mocked tests, authentication tests, and live Dataverse tests), updates CI workflows to collect coverage and run integration tests, and configures Codecov for coverage tracking.
Key changes:
- Three new test projects with infrastructure for mocked Dataverse tests (FakeXrmEasy), authentication validation, and live environment tests with conditional skip logic
- CI/CD enhancements: coverage collection in test.yml, new integration-tests.yml workflow for trusted PRs, and Codecov configuration with per-package thresholds
- Pre-commit hook refinements to fix Windows path issues and improve command filtering
Reviewed changes
Copilot reviewed 17 out of 18 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
tests/PPDS.LiveTests/PPDS.LiveTests.csproj |
New test project for live Dataverse connection tests |
tests/PPDS.LiveTests/LiveDataverseSmokeTests.cs |
Smoke tests validating live test infrastructure and credential detection |
tests/PPDS.LiveTests/Infrastructure/SkipIfNoCredentialsAttribute.cs |
Custom xUnit attributes to conditionally skip tests based on credential availability |
tests/PPDS.LiveTests/Infrastructure/LiveTestConfiguration.cs |
Configuration class reading credentials from environment variables |
tests/PPDS.LiveTests/Infrastructure/LiveTestBase.cs |
Base class and fixture for live integration tests with setup/teardown support |
tests/PPDS.Dataverse.IntegrationTests/PPDS.Dataverse.IntegrationTests.csproj |
New test project using FakeXrmEasy for mocked Dataverse operations |
tests/PPDS.Dataverse.IntegrationTests/FakeXrmEasyTestsBase.cs |
Base class providing FakeXrmEasy context with middleware configuration |
tests/PPDS.Dataverse.IntegrationTests/FakeXrmEasySmokeTests.cs |
Smoke tests verifying FakeXrmEasy infrastructure and CRUD operations |
tests/PPDS.Auth.IntegrationTests/PPDS.Auth.IntegrationTests.csproj |
New test project for authentication flow validation |
tests/PPDS.Auth.IntegrationTests/AuthenticationSmokeTests.cs |
Basic smoke tests for authentication library types |
codecov.yml |
Codecov configuration with component-based coverage targets |
PPDS.Sdk.sln |
Solution file updated with three new test projects |
.gitignore |
Added coverage directory to ignore list |
.github/workflows/test.yml |
Updated to collect XPlat Code Coverage and upload to Codecov |
.github/workflows/integration-tests.yml |
New workflow for running integration tests on trusted PRs |
.github/dependabot.yml |
Added FakeXrmEasy to dependency update groups |
.claude/settings.json |
Refined pre-commit hook matcher and fixed Windows path handling |
.claude/hooks/pre-commit-validate.py |
Simplified logic relying on matcher filtering |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- FakeXrmEasyTestsBase: Call Context.Dispose() to prevent resource leak - LiveDataverseSmokeTests: Fix tautology, improve assertion logic - LiveDataverseSmokeTests: Remove redundant [Trait] (inherited from base) - AuthenticationSmokeTests: Remove Integration trait (no external deps) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add section 5 documenting the correct gh api syntax for replying to individual PR review comments using in_reply_to parameter. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Gemini's suggestion was incorrect - IXrmFakedContext interface doesn't declare IDisposable. Use safe cast to dispose if runtime type supports it. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update review-bot-comments command to make the process explicit: 1. Fetch and triage comments 2. Present summary with recommendations 3. WAIT for user approval (do NOT auto-implement) 4. Implement approved changes 5. Build and verify before committing 6. Reply to comments Added warning about bot suggestions being wrong (e.g., Gemini suggested calling Dispose on an interface that doesn't implement IDisposable). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Rename install-local.ps1 to Install-LocalCli.ps1 (PowerShell Verb-Noun convention) - Delete ppds-dev.ps1 (trivial wrapper that just called dotnet run) - Add New-TestCertificate.ps1 for generating Azure App Registration test certificates 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary
Changes
Integration Testing Infrastructure (#55 Phase 1)
PPDS.Dataverse.IntegrationTestsPPDS.Auth.IntegrationTestsPPDS.LiveTestsKey components:
FakeXrmEasyTestsBase- Base class with middleware builder (RPL-1.5 license)LiveTestBase- Base class with[Trait("Category", "Integration")]for filteringSkipIfNoCredentialsAttribute- Skips tests when credentials unavailableintegration-tests.yml- Approach B workflow (trusted PRs get integration tests)Code Coverage (#84)
test.ymlto collect coverage with--collect:"XPlat Code Coverage"codecov.ymlwith per-package thresholds (informational only)Baseline coverage:
Pre-commit Hook Fix
git commitcommands$CLAUDE_PROJECT_DIRTest plan
--warnaserrorNext Steps
After merge:
test-dataverseGitHub environment with secrets🤖 Generated with Claude Code